#pragma once
#include <utility>
#include <vector>
class UnionFind {

    std::vector<int> parents;

  public:
    UnionFind(int totalNodes);
    void Union(int node1, int node2);
    int find(int node);
    bool isConnected(int node1, int node2);
};
